﻿<%@ Page Language="C#" MasterPageFile="~/Admin/QuanLy.master" AutoEventWireup="true"
     CodeFile="QuanLyKhoanChi.aspx.cs" Inherits="Admin_QuanLyKhoanChi" Title="Quản lý khoản chi"
     Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="content_t">
        &nbsp;</div>
    <div id="content">
        <div align="center" id="list">
            <h3>
                Danh sách các khoản đã chi</h3>
            <asp:GridView SkinID="GridView" ID="GridView1" runat="server" AutoGenerateColumns="False"
                OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating">
                <Columns>
                    <asp:BoundField DataField="MaKhoanChi" HeaderText="Mã khoản chi" 
                        ReadOnly="True" />
                    <asp:TemplateField HeaderText="Chi tiết khoản chi">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("ChiTietKhoanChi") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox1" runat="server" Text='<%# Bind("ChiTietKhoanChi") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên người nhận">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("TenNguoiNhan") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox2" runat="server" Text='<%# Bind("TenNguoiNhan") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Số tiền chi">
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("SoTien") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox3" runat="server" Text='<%# Bind("SoTien") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="NgayChi" HeaderText="Ngày chi" ReadOnly="True" />
                    <asp:CommandField ShowEditButton="True" CancelText="Bỏ" EditText="Sửa" UpdateText="Sửa">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CommandField>
                    <asp:CommandField ShowDeleteButton="True" DeleteText="Xóa">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CommandField>
                </Columns>
            </asp:GridView>
        </div>
        <div align="center" id="form">
            <asp:Table ID="tblThem" SkinID="Table" runat="server" Visible="False">
                <asp:TableHeaderRow SkinID="TableHeaderRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                Nhập khoản chi</asp:TableHeaderCell>
                </asp:TableHeaderRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Chi tiết khoản chi
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox ID="txtChiTiet" CssClass="TextBox" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtChiTiet"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Người nhận
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox ID="txtNguoiNhan" CssClass="TextBox" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtNguoiNhan"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Số tiền
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox ID="txtSoTien" CssClass="TextBox" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtSoTien"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableFooterRow SkinID="TableFooterRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        <asp:Button ID="btnLuu" runat="server" OnClick="btnLuu_Click" Text="Lưu" />
                        <asp:Button ID="btnHuy" runat="server" OnClick="btnHuy_Click" Text="Hủy" CausesValidation="False" />
                    </asp:TableHeaderCell>
                </asp:TableFooterRow>
            </asp:Table>
            <asp:Button ID="btnThem" runat="server" Text="Thêm khoản chi" OnClick="btnThem_Click"
                CausesValidation="False" />
        </div>
    </div>
    <div id="content_b">
        &nbsp;</div>
</asp:Content>

